import { Injectable } from '@nestjs/common';
import { WordTokenizer } from 'natural';

@Injectable()
export class NlpService {
  handler() {
    const tokenizer = new WordTokenizer();
    const text_en = 'your dog has fleas.';
    const text_zh = '这是一个自然语言处理的例子。 这里有一些文本进行处理。';
    const tokens_en = tokenizer.tokenize(text_en);
    const tokens_zh = tokenizer.tokenize(text_zh);
    console.log(tokens_en);
    console.log(tokens_zh);
    return 'NLP handler';
  }
}
